<template>
  <LayOut />
</template>

<script setup lang="ts">
import LayOut from '@/layout/index.vue'
import useUserStore from '@store/modules/user'

document.addEventListener('contextmenu', function (event) {
  event.preventDefault()
})

const userStore = useUserStore()

const clearCache = () => {
  localStorage.clear() // 清除 LocalStorage
  userStore.userLogout()
}

onMounted(() => {
  window.addEventListener('beforeunload', clearCache)
})

onUnmounted(() => {
  window.removeEventListener('beforeunload', clearCache)
})
</script>

<style lang="scss"></style>
